<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="index.js"></script>
<script>
    const emitter = new DzEmitter()

    const onClickFn = data => {
        console.log('on-1', data);
    }
    const onClickFn2 = data => {
        console.log('on-2', data);
    }
    const onceClickFn = data => {
        console.log('once-1', data);
    }

    emitter.on('onClick', onClickFn)
    emitter.on('onClick', onClickFn2)
    emitter.once('onceClick', onceClickFn)

    // emitter.off('onClick', onClickFn2)
    // emitter.off('onClick')

    setTimeout(() => {
        emitter.emit('onClick', `触发事件：onClick`)
        emitter.emit('onceClick', `触发事件：onceClick`)
        console.log(emitter);
    }, 1000)
</script>
</body>
</html>
